package com.demo.lifeinfo.widget;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.demo.lifeinfo.R;
import com.lxj.xpopup.core.BottomPopupView;

/**
 * created by Raymond
 * on 2019-04-29
 */
public class CustomPopup extends BottomPopupView {

    String text;

    private CustomPopup(@NonNull Context context) {
        super(context);
    }

    public CustomPopup(@NonNull Context context, String text) {
        this(context);
        this.text = text;
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.popupview_custom;

    }

    @Override
    protected void onCreate() {
        super.onCreate();
        TextView textView = findViewById(R.id.neirong);
        textView.setText(text);
        findViewById(R.id.cross).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }
}
